package com.it.security.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class test {
    @RequestMapping("/")
    public String index(){
        return "欢迎来到首页";

    }
    @RequestMapping("/success")
    public String loginSuccess(){
        return "恭喜，登录成功！";
    }
    @RequestMapping("/security")
    public String security(){
        return "访问页面";
    }
    @RequestMapping("/security2")
    @PreAuthorize("hasAuthority('1')")//权限校验
    public String security2(){
        return "访问页面2";
    }



}
